<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        span{
            color: orange;
            margin-left: 20px;
        }
    </style>
</head>
<body>
    <input type="text">
    <button>查询</button>
    <ul></ul>
    <script src="./ajax.js"></script>
    <script>
        let txt = $('input')
        let btn = $('button')
        let ul = $('ul')

        btn.onclick=function(){
            ajax_get({
                url:'https://api.oioweb.cn/api/weather/weather',
                params:{city_name:txt.value.trim(),},
                success(data){
                    console.log(JSON.parse(data));
                }
            }
            )
        }
    </script>
</body>
</html>